<%@page contentType="text/html;charset=utf-8"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
ul li {
	text-decoration: none;
	list-style-type: none;
	line-height: 20px;
}

body {
	font-family: 宋体, Arial, Helvetica, sans-serif;
	font-size: 12px;
	background: #769b72 url(../images/booksaleimg/bg_grad.gif) top center
		no-repeat;
	cursor: default;
	color: #404040;
	margin: 0;
	padding: 0;
}
</style>
</head>
<body>
	<div style="width: 60%;margin:20px auto;">
		<div style="width:100%;float: left;">
			<h1>
				
			</h1>
			<span><font color="#cccccc">丛书名：</font></span>
			<hr />
			<div>
				<div style="float: left;width:20%;">
					<img src="${pageContext.request.contextPath}/productImages/${book.image}"  border=0 />
				</div>
				<div style="float: left;width:80%">
					<ul class="info">

						<li>作&nbsp;者：${book.name}</li>
						<li>出版社：新华出版社</li>
						<li style="float:left;width:50%;">出版时间：${book.date}</li>
						<li style="float:left;width:50%;">字数：1200字</li>
						<li style="float:clear;"></li>
						<li style="float:left;width:50%;">版次：2019.1</li>
						<li style="float:left;width:50%;">页数：5页</li>
						<li style="float:clear;"></li>
						<li style="float:left;width:50%;">印刷时间：2018.7</li>
						<li style="float:left;width:50%;">开本：	1</li>
						<li style="float:clear;"></li>
						<li style="float:left;width:50%;">印次：4</li>
						<li style="float:left;width:50%;">纸张：A4</li>
						<li style="float:clear;"></li>
						<li style="float:left;width:50%;">ISBN：</li>
						<li style="float:left;width:50%;">包装：精品</li>
						<li>
							<div class='your_position'>
								您现在的位置:&nbsp; <a href='${pageContext.request.contextPath}/mains/mains_selectOrder'>当当图书</a> &gt;&gt; ${message.cname}&gt;&gt;${message.cate.cname}
								<font style='color: #cc3300'> 
									<strong> 
									</strong>
								</font>
							</div>
						</li>
						<li>定价：￥${book.price}&nbsp;&nbsp;
							当当价：￥${book.dangPrice}&nbsp;&nbsp; 节省：￥${book.price-book.dangPrice}</li>
						<li><a href="javascript:void (0)" onclick="changImg(${book.id})"> <img
								src='${pageContext.request.contextPath}/images/buttom_goumai.gif' class="abc"
								 />
						</a></li>
					</ul>
				</div>
				<div style="float: clear;"></div>
			</div>
		</div>
	</div>
  <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.11.1.js"></script>
<script type="text/javascript">
	function changImg(book_id) {
	      var xml =new  XMLHttpRequest;
	      xml.open("post","${pageContext.request.contextPath}/carts/carts_Cart?book_id="+book_id)
	       xml.onreadystatechange=function () {
			   if (xml.readyState==	4&xml.status==200){
			   		var text = xml.responseText;
			   		console.log(text)
			   		if (text=="true"){
			   			setTimeout(function () {
							$("[class=abc]").prop("src","${pageContext.request.contextPath}/images/xs.gif")
							setTimeout(function () {
								$("[class=abc]").prop("src","${pageContext.request.contextPath}/images/xianshi.gif")
								setTimeout(function () {
									$("[class=abc]").prop("src","${pageContext.request.contextPath}/images/buttom_goumai.gif")
								},900)
							},600)
						},300)
					}
			   }
		   }
		xml.send()
	}
</script>
</body>
</html>